#include <iostream>
using namespace std;

signed main()
{
    int chip,k;
    cin>>chip>>k;
    for(int i=0;i<k&&chip;i++){
        int n1,b,t,n2;
        cin>>n1>>b>>t>>n2;
        if(t>chip){
            printf("Not enough tokens.  Total = %d.\n",chip);
            continue;
        }
        if(n2>n1&&b || n2<n1&&!b){
            chip += t;
            printf("Win %d!  Total = %d.\n",t,chip);
        }
        else{
            chip -= t;
            printf("Lose %d.  Total = %d.\n",t,chip);
        }
    }
    if(!chip)    cout<<"Game Over.\n";
    return 0;
}
